package com.example.demo.model.entity.achievement;

import com.example.demo.model.enums.PaperStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ResearchPaper {

    private Long id;
    private String paperTitle;
    private String journal;
    private String issue;
    private String volume;
    private String pageRange;
    private String indexLevel;
    private String authors; // JSON格式
    private String firstAuthor;
    private String correspondingAuthor;
    private LocalDate publishDate;
    private Double impactFactor;
    private String paperLink;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    private Integer status; // 使用枚举的code值存储
    private Long submitUserId;

    // 获取枚举状态的方法
    public PaperStatusEnum getStatusEnum() {
        return PaperStatusEnum.fromCode(this.status);
    }

    // 设置枚举状态的方法
    public void setStatusEnum(PaperStatusEnum status) {
        this.status = status.getCode();
    }


}